package com.conf4j;

import java.util.Properties;

import com.conf4j.ConfigManager;

/**
 * @author dingnate
 *
 */
public class Main {
	public static void main(String[] args) {
		// 通过配置类的me获取实例调用配置属性
		System.out.println(DemoConf.me);
		// 通过ConfigManager.config(配置类)获取实例调用配置属性
		System.out.println(ConfigManager.config(DemoConf.class));
		// 通过ConfigManager.putProperties()追加自定义全局配置属性
		Properties properties = new Properties();
		String testPropertyKey = "test.add.property.key";
		properties.setProperty(testPropertyKey, "test.add.property.value");
		ConfigManager.putProperties(properties);
		System.out.println(testPropertyKey + "=" + ConfigManager.getValueByKey(testPropertyKey));
	}
}
